package com.medialog.svnTest;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

public class SvnConnMain {
	
	public static void main(String[] args){
		SvnConnection svn = SvnConnection.getInstance();
		List<SvnDomain> list = svn.getTreeviewEntries("/api");
		
		/*for(SvnDomain dto : list){
			System.out.println(dto.getFnId() +" | "+ dto.getFnAlias() +" | "+ dto.getFnParentId() +" | "+ dto.getFnOrder());
		}*/
		
		StringBuilder rtnValue = new StringBuilder();
		
		try {
			Map<String, List<SvnDomain>> menu = new HashMap<String, List<SvnDomain>>();
			menu.put("TESTKey", list);
			
			rtnValue.append(new ObjectMapper().writeValueAsString(menu));
			
		} catch (JsonGenerationException e) { e.printStackTrace();
		} catch (JsonMappingException e) { e.printStackTrace();
		} catch (IOException e) { e.printStackTrace();
		} catch (Exception e) { e.printStackTrace();
		}
		
		System.out.println(rtnValue.toString());
	}

}
